{% extends "blog/themes/%s/base.html" % config.theme %}
{% block title %}{{config.blog_name|e}}{% endblock %}
{% block body %}
{# newly installed blog with no_post #}
	{% if no_post %}
	<div class="block">
		<div class="content">
			<div class="inner">
				<h2>Welcome to the The O-Kay-Blog</h2>
				<p>Your flashy new blog needs some content!</p>
				<p>Create some new posts at the Admin Page.</p>
				<p>
				<a href="/admin/newpost">Go to the Admin Page.</a>
				</p>	
			</div>
		</div>
	</div>
	{% endif %}	
	{% for post in posts %}
	<!-- post -->
	<div class="block">
        <div class="secondary-navigation">
          <ul>
            <li class="first"><a href="{{post.path}}" rel="bookmark" title="Permanent Link:{{post.title|e}}">{{post.title|e}}</a></li>
          </ul>
          <div class="clear"></div>
        </div>
        <div class="content">
			<div class="inner">
			<p>
				<span class="post-meta">Posted by {{config.author_name|e}} on {{post.published|date("%d %B, %Y")}}</span>
			</p>
			<div class="clear"></div>
			{{post.summary|safe}}
				<div>
			    <p>
			      <a href="{{post.path}}" class="readmore">Read more</a>
			      {% if config.disqus_forum %}
			       | <a href="{{post.path}}#disqus_thread" class="readmore">Comments</a>
			      {% endif %}
			    </p>
				</div>
			</div>
		</div>
    </div>
	<!-- /post -->
	{% endfor %}
	
	{% if prev_page or next_page %}
    <div class="block">
      <div class="content">
        <div class="inner">
	        <div class="pagination">
			{% if prev_page %}<a href="{{prev_page}}">« Older Entries</a>{% endif %}
			{% if next_page %}<a rel="next" href="{{next_page}}">Newer Entries »</a>{% endif %}
            </div>
            <div class="clear"></div>
        </div>
      </div>
    </div>
	{% endif %}
	<div class="clear"></div>
  {% if config.disqus_forum %}
    <script type="text/javascript">
    //<![CDATA[
    (function() {
      var links = document.getElementsByTagName('a');
      var query = '?';
      for(var i = 0; i < links.length; i++) {
      if(links[i].href.indexOf('#disqus_thread') >= 0) {
        query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
      }
      }
      document.write('<script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/{{config.disqus_forum}}/get_num_replies.js' + query + '"></' + 'script>');
    })();
    //]]>
    </script>
  {% endif %}
{% endblock %}
